package com.ssss.template.exec;

public abstract class HummerModel {

    protected abstract void start(); // 发动
    protected abstract void engineBoom(); // 轰鸣
    protected abstract void alarm(); // 鸣笛
    protected abstract void stop(); // 停止

    final public void run(){
        start();
        engineBoom();
        if (this.isAlarm()){
            alarm();
        }
        stop();
    }

    protected boolean isAlarm(){
        return true;
    }
}
